package com.it.sun.learning001.config;

import org.springframework.aop.aspectj.AspectJExpressionPointcutAdvisor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * @ClassName com.it.sun.learning001.config.BaseConfiguration
 * @Author sunmannian
 * @Date 2021/6/24 18:08
 * @Version V1.0
 * Description  <请输入一句话描述该类功能>
 * Copyright (C) 北京中电兴发科技有限公司  since 2021/6/24
 */
@EnableAspectJAutoProxy(proxyTargetClass = true)
@Configuration
public class BaseConfiguration {

	@Bean()
	public AspectJExpressionPointcutAdvisor aspectJExpressionPointcutAdvisor() {
		AspectJExpressionPointcutAdvisor aspectJExpressionPointcutAdvisor = new AspectJExpressionPointcutAdvisor();
		aspectJExpressionPointcutAdvisor.setExpression("@annotation(com.it.sun.learning001.annotation.Log)");
		aspectJExpressionPointcutAdvisor.setAdvice(new LogInterceptor());
		return aspectJExpressionPointcutAdvisor;
	}
}



